3.4.87 \(\int (d+e x^r)^2 (a+b \log (c x^n)) \, dx\) [387]

Optimal. Leaf size=113 \[ -b d^2 n x-\frac {2 b d e n x^{1+r}}{(1+r)^2}-\frac {b e^2 n x^{1+2 r}}{(1+2 r)^2}+d^2 x \left (a+b \log \left (c x^n\right )\right )+\frac {2 d e x^{1+r} \left (a+b \log \left (c x^n\right )\right )}{1+r}+\frac {e^2 x^{1+2 r} \left (a+b \log \left (c x^n\right )\right )}{1+2 r} \]

[Out]

-b*d^2*n*x-2*b*d*e*n*x^(1+r)/(1+r)^2-b*e^2*n*x^(1+2*r)/(1+2*r)^2+d^2*x*(a+b*ln(c*x^n))+2*d*e*x^(1+r)*(a+b*ln(c
*x^n))/(1+r)+e^2*x^(1+2*r)*(a+b*ln(c*x^n))/(1+2*r)

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 113, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {250, 2350} \begin {gather*} d^2 x \left (a+b \log \left (c x^n\right )\right )+\frac {2 d e x^{r+1} \left (a+b \log \left (c x^n\right )\right )}{r+1}+\frac {e^2 x^{2 r+1} \left (a+b \log \left (c x^n\right )\right )}{2 r+1}-b d^2 n x-\frac {2 b d e n x^{r+1}}{(r+1)^2}-\frac {b e^2 n x^{2 r+1}}{(2 r+1)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d + e*x^r)^2*(a + b*Log[c*x^n]),x]

[Out]

-(b*d^2*n*x) - (2*b*d*e*n*x^(1 + r))/(1 + r)^2 - (b*e^2*n*x^(1 + 2*r))/(1 + 2*r)^2 + d^2*x*(a + b*Log[c*x^n])
+ (2*d*e*x^(1 + r)*(a + b*Log[c*x^n]))/(1 + r) + (e^2*x^(1 + 2*r)*(a + b*Log[c*x^n]))/(1 + 2*r)

Rule 250

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[(a + b*x^n)^p, x], x] /; FreeQ[{a, b, n},
x] && IGtQ[p, 0]

Rule 2350

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = IntHide[(d +
 e*x^r)^q, x]}, Dist[a + b*Log[c*x^n], u, x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]] /; FreeQ[{a, b
, c, d, e, n, r}, x] && IGtQ[q, 0]

Rubi steps

\begin {align*} \int \left (d+e x^r\right )^2 \left (a+b \log \left (c x^n\right )\right ) \, dx &=\left (d^2 x+\frac {2 d e x^{1+r}}{1+r}+\frac {e^2 x^{1+2 r}}{1+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (d^2+\frac {2 d e x^r}{1+r}+\frac {e^2 x^{2 r}}{1+2 r}\right ) \, dx\\ &=-b d^2 n x-\frac {2 b d e n x^{1+r}}{(1+r)^2}-\frac {b e^2 n x^{1+2 r}}{(1+2 r)^2}+\left (d^2 x+\frac {2 d e x^{1+r}}{1+r}+\frac {e^2 x^{1+2 r}}{1+2 r}\right ) \left (a+b \log \left (c x^n\right )\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.15, size = 106, normalized size = 0.94 \begin {gather*} x \left (b d^2 n \log (x)+d^2 \left (a-b n-b n \log (x)+b \log \left (c x^n\right )\right )+\frac {2 d e x^r \left (a-b n+a r+b (1+r) \log \left (c x^n\right )\right )}{(1+r)^2}+\frac {e^2 x^{2 r} \left (a-b n+2 a r+(b+2 b r) \log \left (c x^n\right )\right )}{(1+2 r)^2}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(d + e*x^r)^2*(a + b*Log[c*x^n]),x]

[Out]

x*(b*d^2*n*Log[x] + d^2*(a - b*n - b*n*Log[x] + b*Log[c*x^n]) + (2*d*e*x^r*(a - b*n + a*r + b*(1 + r)*Log[c*x^
n]))/(1 + r)^2 + (e^2*x^(2*r)*(a - b*n + 2*a*r + (b + 2*b*r)*Log[c*x^n]))/(1 + 2*r)^2)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.18, size = 1921, normalized size = 17.00

method result size
risch \(\text {Expression too large to display}\) \(1921\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d+e*x^r)^2*(a+b*ln(c*x^n)),x,method=_RETURNVERBOSE)

[Out]

b*x*(e^2*(x^r)^2*r+2*d^2*r^2+4*d*e*x^r*r+e^2*(x^r)^2+3*d^2*r+2*d*e*x^r+d^2)/(1+2*r)/(1+r)*ln(x^n)-1/2*x*(-2*e^
2*(x^r)^2*a+2*I*Pi*b*d*e*csgn(I*c*x^n)^3*x^r-2*I*Pi*b*e^2*r^3*csgn(I*c)*csgn(I*c*x^n)^2*(x^r)^2+4*I*Pi*b*d^2*r
^4*csgn(I*c*x^n)^3-I*Pi*b*d^2*csgn(I*c)*csgn(I*c*x^n)^2-I*Pi*b*d^2*csgn(I*x^n)*csgn(I*c*x^n)^2-2*I*Pi*b*d*e*cs
gn(I*c)*csgn(I*c*x^n)^2*x^r-4*d*e*x^r*a-I*Pi*b*e^2*csgn(I*x^n)*csgn(I*c*x^n)^2*(x^r)^2+I*Pi*b*e^2*csgn(I*c)*cs
gn(I*x^n)*csgn(I*c*x^n)*(x^r)^2+4*I*Pi*b*e^2*r*csgn(I*c*x^n)^3*(x^r)^2+26*b*d^2*n*r^2+12*b*d^2*n*r-26*ln(c)*b*
d^2*r^2-12*ln(c)*b*d^2*r-8*ln(c)*b*d^2*r^4-24*ln(c)*b*d^2*r^3-2*d^2*b*ln(c)+2*b*d^2*n-2*a*d^2+8*b*d^2*n*r^4+24
*b*d^2*n*r^3-8*a*d^2*r^4-24*a*d^2*r^3-26*a*d^2*r^2-12*a*d^2*r+I*Pi*b*d^2*csgn(I*c*x^n)^3-2*ln(c)*b*e^2*(x^r)^2
-6*I*Pi*b*d^2*r*csgn(I*x^n)*csgn(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*ln(c)*b*d*e*r^3*x^r+16*b*d*e*n*r^2*x^r+10*I*Pi*b*d*e*r*csgn(I*c*x^n)^3*x^r-2
*I*Pi*b*e^2*r^3*csgn(I*x^n)*csgn(I*c*x^n)^2*(x^r)^2+12*I*Pi*b*d^2*r^3*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+4*I*
Pi*b*d^2*r^4*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n))/(1+2*r)^2/(1+r)^2

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 144, normalized size = 1.27 \begin {gather*} -b d^{2} n x + b d^{2} x \log \left (c x^{n}\right ) + a d^{2} x + \frac {b e^{2} x^{2 \, r + 1} \log \left (c x^{n}\right )}{2 \, r + 1} + \frac {2 \, b d e x^{r + 1} \log \left (c x^{n}\right )}{r + 1} - \frac {b e^{2} n x^{2 \, r + 1}}{{\left (2 \, r + 1\right )}^{2}} + \frac {a e^{2} x^{2 \, r + 1}}{2 \, r + 1} - \frac {2 \, b d e n x^{r + 1}}{{\left (r + 1\right )}^{2}} + \frac {2 \, a d e x^{r + 1}}{r + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n)),x, algorithm="maxima")

[Out]

-b*d^2*n*x + b*d^2*x*log(c*x^n) + a*d^2*x + b*e^2*x^(2*r + 1)*log(c*x^n)/(2*r + 1) + 2*b*d*e*x^(r + 1)*log(c*x
^n)/(r + 1) - b*e^2*n*x^(2*r + 1)/(2*r + 1)^2 + a*e^2*x^(2*r + 1)/(2*r + 1) - 2*b*d*e*n*x^(r + 1)/(r + 1)^2 +
2*a*d*e*x^(r + 1)/(r + 1)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 416 vs. \(2 (113) = 226\).
time = 0.37, size = 416, normalized size = 3.68 \begin {gather*} \frac {{\left (4 \, b d^{2} r^{4} + 12 \, b d^{2} r^{3} + 13 \, b d^{2} r^{2} + 6 \, b d^{2} r + b d^{2}\right )} x \log \left (c\right ) + {\left (4 \, b d^{2} n r^{4} + 12 \, b d^{2} n r^{3} + 13 \, b d^{2} n r^{2} + 6 \, b d^{2} n r + b d^{2} n\right )} x \log \left (x\right ) - {\left (4 \, {\left (b d^{2} n - a d^{2}\right )} r^{4} + b d^{2} n + 12 \, {\left (b d^{2} n - a d^{2}\right )} r^{3} - a d^{2} + 13 \, {\left (b d^{2} n - a d^{2}\right )} r^{2} + 6 \, {\left (b d^{2} n - a d^{2}\right )} r\right )} x + {\left ({\left (2 \, b r^{3} + 5 \, b r^{2} + 4 \, b r + b\right )} x e^{2} \log \left (c\right ) + {\left (2 \, b n r^{3} + 5 \, b n r^{2} + 4 \, b n r + b n\right )} x e^{2} \log \left (x\right ) + {\left (2 \, a r^{3} - {\left (b n - 5 \, a\right )} r^{2} - b n - 2 \, {\left (b n - 2 \, a\right )} r + a\right )} x e^{2}\right )} x^{2 \, r} + 2 \, {\left ({\left (4 \, b d r^{3} + 8 \, b d r^{2} + 5 \, b d r + b d\right )} x e \log \left (c\right ) + {\left (4 \, b d n r^{3} + 8 \, b d n r^{2} + 5 \, b d n r + b d n\right )} x e \log \left (x\right ) + {\left (4 \, a d r^{3} - b d n - 4 \, {\left (b d n - 2 \, a d\right )} r^{2} + a d - {\left (4 \, b d n - 5 \, a d\right )} r\right )} x e\right )} x^{r}}{4 \, r^{4} + 12 \, r^{3} + 13 \, r^{2} + 6 \, r + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n)),x, algorithm="fricas")

[Out]

((4*b*d^2*r^4 + 12*b*d^2*r^3 + 13*b*d^2*r^2 + 6*b*d^2*r + b*d^2)*x*log(c) + (4*b*d^2*n*r^4 + 12*b*d^2*n*r^3 +
13*b*d^2*n*r^2 + 6*b*d^2*n*r + b*d^2*n)*x*log(x) - (4*(b*d^2*n - a*d^2)*r^4 + b*d^2*n + 12*(b*d^2*n - a*d^2)*r
^3 - a*d^2 + 13*(b*d^2*n - a*d^2)*r^2 + 6*(b*d^2*n - a*d^2)*r)*x + ((2*b*r^3 + 5*b*r^2 + 4*b*r + b)*x*e^2*log(
c) + (2*b*n*r^3 + 5*b*n*r^2 + 4*b*n*r + b*n)*x*e^2*log(x) + (2*a*r^3 - (b*n - 5*a)*r^2 - b*n - 2*(b*n - 2*a)*r
 + a)*x*e^2)*x^(2*r) + 2*((4*b*d*r^3 + 8*b*d*r^2 + 5*b*d*r + b*d)*x*e*log(c) + (4*b*d*n*r^3 + 8*b*d*n*r^2 + 5*
b*d*n*r + b*d*n)*x*e*log(x) + (4*a*d*r^3 - b*d*n - 4*(b*d*n - 2*a*d)*r^2 + a*d - (4*b*d*n - 5*a*d)*r)*x*e)*x^r
)/(4*r^4 + 12*r^3 + 13*r^2 + 6*r + 1)

________________________________________________________________________________________

Sympy [A]
time = 5.18, size = 211, normalized size = 1.87 \begin {gather*} a d^{2} x + 2 a d e \left (\begin {cases} \frac {x^{r + 1}}{r + 1} & \text {for}\: r \neq -1 \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) + a e^{2} \left (\begin {cases} \frac {x^{2 r + 1}}{2 r + 1} & \text {for}\: r \neq - \frac {1}{2} \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) - b d^{2} n x + b d^{2} x \log {\left (c x^{n} \right )} - 2 b d e n \left (\begin {cases} \frac {\begin {cases} \frac {x x^{r}}{r + 1} & \text {for}\: r \neq -1 \\\log {\left (x \right )} & \text {otherwise} \end {cases}}{r + 1} & \text {for}\: r > -\infty \wedge r < \infty \wedge r \neq -1 \\\frac {\log {\left (x \right )}^{2}}{2} & \text {otherwise} \end {cases}\right ) + 2 b d e \left (\begin {cases} \frac {x^{r + 1}}{r + 1} & \text {for}\: r \neq -1 \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )} - b e^{2} n \left (\begin {cases} \frac {\begin {cases} \frac {x x^{2 r}}{2 r + 1} & \text {for}\: r \neq - \frac {1}{2} \\\log {\left (x \right )} & \text {otherwise} \end {cases}}{2 r + 1} & \text {for}\: r > -\infty \wedge r < \infty \wedge r \neq - \frac {1}{2} \\\frac {\log {\left (x \right )}^{2}}{2} & \text {otherwise} \end {cases}\right ) + b e^{2} \left (\begin {cases} \frac {x^{2 r + 1}}{2 r + 1} & \text {for}\: r \neq - \frac {1}{2} \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x**r)**2*(a+b*ln(c*x**n)),x)

[Out]

a*d**2*x + 2*a*d*e*Piecewise((x**(r + 1)/(r + 1), Ne(r, -1)), (log(x), True)) + a*e**2*Piecewise((x**(2*r + 1)
/(2*r + 1), Ne(r, -1/2)), (log(x), True)) - b*d**2*n*x + b*d**2*x*log(c*x**n) - 2*b*d*e*n*Piecewise((Piecewise
((x*x**r/(r + 1), Ne(r, -1)), (log(x), True))/(r + 1), (r > -oo) & (r < oo) & Ne(r, -1)), (log(x)**2/2, True))
 + 2*b*d*e*Piecewise((x**(r + 1)/(r + 1), Ne(r, -1)), (log(x), True))*log(c*x**n) - b*e**2*n*Piecewise((Piecew
ise((x*x**(2*r)/(2*r + 1), Ne(r, -1/2)), (log(x), True))/(2*r + 1), (r > -oo) & (r < oo) & Ne(r, -1/2)), (log(
x)**2/2, True)) + b*e**2*Piecewise((x**(2*r + 1)/(2*r + 1), Ne(r, -1/2)), (log(x), True))*log(c*x**n)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 244 vs. \(2 (113) = 226\).
time = 2.47, size = 244, normalized size = 2.16 \begin {gather*} \frac {2 \, b d n r x x^{r} e \log \left (x\right )}{r^{2} + 2 \, r + 1} + b d^{2} n x \log \left (x\right ) + \frac {2 \, b n r x x^{2 \, r} e^{2} \log \left (x\right )}{4 \, r^{2} + 4 \, r + 1} + \frac {2 \, b d n x x^{r} e \log \left (x\right )}{r^{2} + 2 \, r + 1} - b d^{2} n x - \frac {2 \, b d n x x^{r} e}{r^{2} + 2 \, r + 1} + b d^{2} x \log \left (c\right ) + \frac {2 \, b d x x^{r} e \log \left (c\right )}{r + 1} + \frac {b n x x^{2 \, r} e^{2} \log \left (x\right )}{4 \, r^{2} + 4 \, r + 1} + a d^{2} x - \frac {b n x x^{2 \, r} e^{2}}{4 \, r^{2} + 4 \, r + 1} + \frac {2 \, a d x x^{r} e}{r + 1} + \frac {b x x^{2 \, r} e^{2} \log \left (c\right )}{2 \, r + 1} + \frac {a x x^{2 \, r} e^{2}}{2 \, r + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d+e*x^r)^2*(a+b*log(c*x^n)),x, algorithm="giac")

[Out]

2*b*d*n*r*x*x^r*e*log(x)/(r^2 + 2*r + 1) + b*d^2*n*x*log(x) + 2*b*n*r*x*x^(2*r)*e^2*log(x)/(4*r^2 + 4*r + 1) +
 2*b*d*n*x*x^r*e*log(x)/(r^2 + 2*r + 1) - b*d^2*n*x - 2*b*d*n*x*x^r*e/(r^2 + 2*r + 1) + b*d^2*x*log(c) + 2*b*d
*x*x^r*e*log(c)/(r + 1) + b*n*x*x^(2*r)*e^2*log(x)/(4*r^2 + 4*r + 1) + a*d^2*x - b*n*x*x^(2*r)*e^2/(4*r^2 + 4*
r + 1) + 2*a*d*x*x^r*e/(r + 1) + b*x*x^(2*r)*e^2*log(c)/(2*r + 1) + a*x*x^(2*r)*e^2/(2*r + 1)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (d+e\,x^r\right )}^2\,\left (a+b\,\ln \left (c\,x^n\right )\right ) \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d + e*x^r)^2*(a + b*log(c*x^n)),x)

[Out]

int((d + e*x^r)^2*(a + b*log(c*x^n)), x)

________________________________________________________________________________________